package com.iot08.admin.service;


import com.iot08.common.entity.app.DmpAccount;
import com.iot08.common.service.base.BaseService;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author weichao 1299101858@qq.com
 * @version 1.0
 * @date 2021-06-19 14:50
 */
@Service
public class DmpAccountService extends BaseService<DmpAccount> {

    public DmpAccount getById(String id) {
        Query query = new Query(Criteria.where("_id").is(id));
//        query.fields().include("_id").include("badge");
        return this.findOne(query);
    }

    public List<DmpAccount> getAllAccount() {
        return this.mongoTemplate.findAll(DmpAccount.class);
    }

}
